// See https://sequelize.org/master/manual/model-basics.html
// for more of what you can do here.
const Sequelize = require('sequelize');
const DataTypes = Sequelize.DataTypes;

module.exports = function (app) {
  const sequelizeClient = app.get('sequelizeClient');
  const promanage = sequelizeClient.define('promanage', {
    // 类型
    type: {
      type: DataTypes.STRING,
    },
    // 标题
    tittle: {
      type: DataTypes.STRING,
    },
    // 标签
    label: {
      type: DataTypes.STRING,
    },
    // 创建人
    director: {
      type: DataTypes.STRING,
    },
    // 状态
    status: {
      type: DataTypes.STRING,
    },
    // 问题描述
    describe:{
      type:DataTypes.STRING,
    },
    // 解决方案
    resolve:{
      type:DataTypes.STRING,
    }
  }, {
    hooks: {
      beforeCount(options) {
        options.raw = true;
      }
    }
  });

  // eslint-disable-next-line no-unused-vars
  promanage.associate = function (models) {
    // Define associations here
    // See https://sequelize.org/master/manual/assocs.html
  };

  return promanage;
};
